import axios from 'axios'
axios.defaults.baseURL = process.env_VUE_APP_URL
// 创建axios副本
const _axios = axios.create({
  // 配置
  method: 'post',
  baseURL: process.env.VUE_APP_URL
})

// 请求拦截
_axios.interceptors.request.use(
  (config) => {
    return config
  }, (error) => {
    return Promise.request(error)
  })

// 响应拦截
_axios.interceptors.response.use(
  (res) => {
    return res
  }, (error) => {
    return Promise.response(error)
  }
)

export default _axios
